<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<form action="${ctx}/pretreat/submit.do" method="post">
<fieldset><legend>患者详细资料</legend>
<table class="list">
	<thead>
		<tr>
			<th colspan="8" width="100%">治疗前</th>
		</tr>
	</thead>
	<tr>
		<td class="right">空腹血糖：</td>
		<td class="left"><input name="emptyBloodSugar" type="text"
			class="short" value="${patient.pretreat.emptyBloodSugar}" />&nbsp;mmol/L</td>
		<td class="right">餐后2H血糖：</td>
		<td class="left"><input name="twoHourBloodSugar" type="text"
			class="short" value="${patient.pretreat.twoHourBloodSugar}" />&nbsp;mmol/L</td>
		<td class="right">总胆固醇：</td>
		<td class="left"><input name="cholesterol" type="text"
			class="short" value="${patient.pretreat.cholesterol}" />&nbsp;mmol/L</td>
		<td class="right">甘油三脂：</td>
		<td class="left"><input name="triglyceride" type="text"
			class="short" value="${patient.pretreat.triglyceride}" />&nbsp;mmol/L</td>
	</tr>
	<tr>
		<td class="right">尿&nbsp;&nbsp;&nbsp;糖：</td>
		<td class="left"><span style="overflow: hidden"><select
			name="urineSugar" id="urineSugar">
			<c:import url="../include/option_num.jsp" />
		</select>&nbsp;(+)</span></td>
		<td class="right">酮&nbsp;&nbsp;&nbsp;体：</td>
		<td class="left"><span style="overflow: hidden"><select
			name="ketone" id="ketone">
			<c:import url="../include/option_num.jsp" />
		</select>&nbsp;(+)</span></td>
		<td class="right">尿蛋白：</td>
		<td class="left"><span style="overflow: hidden"><select
			name="urineProtein" id="urineProtein">
			<c:import url="../include/option_num.jsp" />
		</select>&nbsp;(+)</span></td>
		<td class="right">尿白细胞：</td>
		<td class="left"><span style="overflow: hidden"><select
			name="urineLeucocyte" id="urineLeucocyte">
			<c:import url="../include/option_num.jsp" />
		</select>&nbsp;(+)</span></td>
	</tr>
</table>
<table class="list">
	<thead>
		<tr>
			<th>药物</th>
			<th>用量</th>
			<th>早</th>
			<th>中</th>
			<th>晚</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><input name="drugName" type="text" class="input"
				id="drugName" /></td>
			<td><span style="overflow: hidden"><select
				name="drugDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="drugName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="drugDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningDose" id="morningDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonDose" id="noonDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightDose" id="nightDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
		<tr>
			<td><input name="drugName" type="text" class="input" /></td>
			<td><span style="overflow: hidden"><select
				name="drugDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="morningDose" id="morningDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonDose" id="noonDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightDose" id="nightDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
	</tbody>
</table>
<table class="list">
	<thead>
		<tr>
			<th>胰岛素</th>
			<th>早</th>
			<th>中</th>
			<th>晚</th>
			<th>睡前</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td><input name="insulinDrugName" type="text" class="input"
				value="${patient.pretreat.insulinDrugName}" /></td>
			<td><span style="overflow: hidden;"><select
				name="morningInsulinDose" id="morningInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="noonInsulinDose" id="noonInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="nightInsulinDose" id="nightInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
			<td><span style="overflow: hidden"><select
				name="bedtimeInsulinDose" id="bedtimeInsulinDose">
				<c:import url="../include/option_dose.jsp" />
			</select>&nbsp;片（粒）</span></td>
		</tr>
	</tbody>
</table>
</fieldset>
<div style="text-align: center;"><input type="submit"
	value="确&nbsp;&nbsp;&nbsp;定" class="submit" />&nbsp;&nbsp;<input
	type="reset" value="重&nbsp;&nbsp;&nbsp;置" class="reset"></div>
</form>
<script type="text/javascript">
	$('#urineSugar').val( [ '${patient.pretreat.urineSugar}' ]);
	$('#ketone').val( [ '${patient.pretreat.ketone}' ]);
	$('#urineProtein').val( [ '${patient.pretreat.urineProtein}' ]);
	$('#urineLeucocyte').val( [ '${patient.pretreat.urineLeucocyte}' ]);

	$('#morningInsulinDose').val( [ '${patient.pretreat.morningInsulinDose}' ]);
	$('#noonInsulinDose').val( [ '${patient.pretreat.noonInsulinDose}' ]);
	$('#nightInsulinDose').val( [ '${patient.pretreat.nightInsulinDose}' ]);
	$('#bedtimeInsulinDose').val( [ '${patient.pretreat.bedtimeInsulinDose}' ]);
	<c:forEach items="${patient.predrugs}" var="predrug"
		varStatus="varStatus">
	$("input[name='drugName']").eq('${varStatus.index}').val('${predrug.drugName}');
	$("select[name='drugDose']").eq('${varStatus.index}').val(['${predrug.drugDose}']);
	$("select[name='morningDose']").eq('${varStatus.index}').val(['${predrug.morningDose}']);
	$("select[name='noonDose']").eq('${varStatus.index}').val(['${predrug.noonDose}']);
	$("select[name='nightDose']").eq('${varStatus.index}').val(['${predrug.nightDose}']);
	</c:forEach>
</script>

